package com.cpj.bsyyzx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cpj.bsyyzx.entity.Bed;
import com.cpj.bsyyzx.entity.BedRecord;
import com.cpj.bsyyzx.mapper.BedRecordMapper;
import com.cpj.bsyyzx.service.IBedRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 五个臭皮匠
 * @since 2021-04-27
 */
@Service
public class BedRecordServiceImpl extends ServiceImpl<BedRecordMapper, BedRecord> implements IBedRecordService {

    @Override
    public Page pageList(Page page, BedRecord bedRecord) {
        if (page == null) {
            page = new Page();
        }
        QueryWrapper wrapper = new QueryWrapper();
        if (bedRecord != null && !StringUtils.isEmpty((bedRecord.getUserName()))) {
            wrapper.like("user_name", bedRecord.getUserName());
        }
        return super.page(page, wrapper);
    }

    @Override
    public List<BedRecord> selectFind(String ConditionValue) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.like("user_name",ConditionValue);
        return super.list(wrapper);
    }





}